import React, {Component} from 'react';
// import './index.css';

class testReact extends Component {
  constructor() {
	super();
	this.state = {
	  currentCompany: '上海新致软件',
	  depts: [
		{id: 1, name: '行政部', company: '上海新致软件', date: "2001-11-02"},
		{id: 2, name: '销售部',  company: '上海新致软件', date: "2011-08-18"},
		{id: 3, name: '开发部', company: '上海新致软件', date: "2018-02-11"},
		{id: 4, name: '测试部', company: '上海新致软件', date: "2018-02-13"},
		{id: 5, name: '运维部', company: '上海新致软件', date: "2018-03-10"},
		{id: 6, name: '后勤部', company: '上海新致软件', date: "2018-04-20"},
	  ]
	}
  }
  onDeptClick(item) {
	// this.setState({
	//   num: index
	// })
  }
  render() {
	return (
		<div className="departments">
		<h3>测试react 微应用 部门管理</h3>
	<span>所属公司：<a href="javascript:;">{this.state.currentCompany}</a></span>
	<ul className="dept-data">
		{
		  this.state.depts.map((item, index) => {
			return (
				<li key={index} >
				<span>{item.name}</span><span>创建于{item.date}</span>
			</li>
		  )
		  })
		}
		</ul>
		</div>
  );
  }
}

export default testReact;
